package com.szc.demo01.dao;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.szc.demo01.pojo.Attence;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
@Repository
public interface AttenceMapper extends BaseMapper<Attence> {
//    boolean addAttenceOne();
    List<Attence>getListByMonth(@Param("month")long month,@Param("e_id")Long e_id);

    Attence getAttenceByEidAndWorkDate(@Param("e_id")Long e_id,@Param("work_date") Date workDate);

    //        update attence set work_end=#{workEnd},work_time=#{workTime}
//        WHERE e_id=#{eId} and work_date=#{workDate}
    int updateAttenceByEidAndWorkDate(@Param("workEnd") String workEnd,@Param("workTime") Long workTime,@Param("eId") Long eId,@Param("workDate") String workDate);

    int insertAttence(Attence attence);

    List<Attence> getListForBoss(@Param("e_id")Long e_id,@Param("month")Integer month,@Param("ename")String ename);

    List<Attence>getListForBossByDay(@Param("work_date")String work_date);

    int batchInsert(@Param("list") List<Attence> list);

    int batchUpdate(@Param("list")List<Attence>list,@Param("work_date") String work_date);

    int  clock_in(@Param("eId")Long eId,@Param("workDate")String workDate,@Param("workStart")String workStart,@Param("isLater")int isLater,@Param("mark")String mark);
}
